<template>
        <span>
            <button @click="clickFun" :class="type">{{name}}</button>
        </span>
</template>

<script>
    export default {
        props:{
            type:{
                default:'primary',
                type:String
            },
            name:{
                require:true,
                type:String
            }
        },
        methods:{
            clickFun(){
                this.$emit('click')
                console.log('LBtn点击事件触发，将去触发自定义click事件');
            }
        }
    }
</script>

<style scoped>
    button{
        border: none;
        width: 70px;
        height: 22px;
        text-align: center;
        color: snow;
        background-color: steelblue;
        vertical-align: middle;
        font-size: 12px;
        cursor: pointer;
    }
    button.warning{
        background-color:coral
    }
    button.danger{
        background-color: crimson;
    }
</style>